/**
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY. 
 * See the GNU General Public License for more details.
 * 
 * Copyright (C) 2011 CellObject.net
 */
package net.cellobject.javacodeformatter.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;

/**
 * Remove each currently selected object from the Favorites collection and place that information on the clipboard.
 */
public class CutFormatterHandler extends AbstractHandler {
	IHandler copy = new CopyFormatterHandler();

	IHandler remove = new RemoveFormatterHandler();

	public Object execute(final ExecutionEvent event) throws ExecutionException {
		copy.execute(event);
		remove.execute(event);
		return null;
	}

	@Override
	public void dispose() {
		copy.dispose();
		remove.dispose();
		super.dispose();
	}
}
